// src/index.js
import './style.css'
import './style2.css'
// import Data from './data.xml'
import txt from './assets/file.txt'
import printMe from './print.js';
import Icon from './general1.png' // 1. 引入图片
function component() {
    var element = document.createElement('div');

    element.innerHTML = "Hello Webpack";

    element.classList.add('color_red') //添加类

    var img = new Image(200, 200); // 2. 使用图片
    img.src = Icon;
    element.appendChild(img);


    var btn = document.createElement('button');
    btn.innerHTML = '点击我';
    btn.onclick = printMe;
    element.appendChild(btn);


    return element;
}
function print() {
    console.log(txt) // 1474623111aaae6b31c08e1fedda68a3.txt
}
print();
document.body.appendChild(component());
